package com.ifnk.portaljava.hlyt.dao;

import com.ifnk.portaljava.hlyt.beans.Log;

import java.sql.Timestamp;
import java.util.List;

public interface ILogDAO {
	String LEVEL = "level";
	String USER_NAME = "userName";
	String USER_IP = "userIp";
	String MODULE_NAME = "moduleName";
	String EVENT = "event";
	String INFO = "info";
	String RESULT = "result";
	
	void save(Log transientInstance);
	void delete(Log persistentInstance);
	Log findById(Integer id);
	List findByExample(Log instance);
	List findByProperty(String propertyName, Object value);
	List findByLevel(Object level);
	List findByUserName(Object userName);
	List findByUserIp(Object userIp);
	List findByModuleName(Object moduleName);
	List findByEvent(Object event);
	List findByInfo(Object info);
	List findByResult(Object result);
	List findAll();
	Log merge(Log detachedInstance);
	void attachDirty(Log instance);
	void attachClean(Log instance);
	/**
	 * 查找所有可能的event取值
	 * @return
	 */
	List<String> findEvent();
	/**
	 * 查找所有可能的level取值
	 * @return
	 */
	List<String> findLevel();
	List<String> findUserName();
	List<String> findResult();
	List<String> findModuleName();
	/**
	 * 查询今天的日志
	 * @return
	 */
	List<Log> findByDate(String dateString);
	List<Log> findLogList(Log log, Timestamp startTime, Timestamp endTime);
}
